# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-sphinx-theme-cloud
_pkgname=cloud_sptheme
pkgver=1.10.0
pkgrel=2
pkgdesc="The Cloud Sphinx theme"
url="https://bitbucket.org/ecollins/cloud_sptheme"
arch="noarch"
license="BSD-3-Clause"
depends="
	py3-sphinx
	python3
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-mock"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	markup.patch
	"
builddir="$srcdir"/$_pkgname-$pkgver
options="!check" # mock fails

replaces="py-sphinx-theme-cloud" # Backwards compatibility
provides="py-sphinx-theme-cloud=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages test-env
	test-env/bin/python3 -m installer .dist/*.whl
	test-env/bin/python3 -m unittest discover
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
296a7db1e30b5012ebaf4117db1ed72cf109ff7bb4dc08c9cce5c7822ca68a5a8f53c8dd84df2780aabcce0509d1cfc48ab459ba3879d8721bbf8ca730307dda  cloud_sptheme-1.10.0.tar.gz
b1af0a7fc60837511ed2be170e1db6649873f3803be4b127d39c76326507af0e7c64b810e84a6046f11078392b1b4fb1dbd4bc0b02670676011b72f5100c6c35  markup.patch
"
